package com.icodingedu.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@Slf4j
public class SleuthController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/traceB")
    public String traceB(){
        log.info("------------TraceB Middle");
        return restTemplate.getForEntity("http://sleuth-traceC/traceC",String.class).getBody();
    }
}
